package com.pactera.asmp.server.dao;

import com.pactera.asmp.server.entity.TestTaskSearchDTO;
import com.pactera.asmp.server.pojo.TestTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ProjectName: asmp-server
 * @Package com.pactera.asmp.server.dao
 * @ClassName: TestTaskMapper
 * @Description: TestTaskMapper
 * @Date 2020/07/14 17:12
 * @Author lvzhiqiang
 * @Version 1.0
 */
@Mapper
public interface TestTaskMapper {

    List<TestTask> select(@Param("testTaskSearchDTO") TestTaskSearchDTO testTaskSearchDTO);

    TestTask selectByTaskId(Integer taskId);

    int insert(TestTask testTask);

    int update(TestTask testTask);

    /**
     * @TOTO 需要同步删除JOB中对应的任务,还需删除对应TaskId下的Report和文件服务器上的文件
     * @param datas
     * @return
     */
    int deleteByPrimaryKey(List<Integer> datas);

    int interrupterWhenExecing(String duid);

    int cancel(Integer id);
    int taskFailById(@Param("id") Integer id,@Param("failReason") String failReason);
}
